﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="up.aspx.cs" Inherits="WebNull.up" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="jquery-1.7.1.min.js"></script>
    <script src="jquery.uploadify.js"></script>
    <script src="jquery.uploadify.min.js"></script>
    <link href="uploadify.css" rel="stylesheet" />
    <script type="text/javascript">
        function AddFile() {
            var strFile = " <input name=\"upload_file\" type='file'  style='WIDTH:350px;'/> <br/>";
            $("#fileQueue").append(strFile);
        }
        $(function () {
            $("#uploadify").uploadify({
          
                'auto': false,
                'swf': 'uploadify.swf',
                'uploader': 'Handler1.ashx',
                'buttonText': '请选择上传文件',
                //按钮背景 'buttonImage': '@Url.Content("~/Scripts/uploadify-v3.1/browse-btn.png")',
                multi: true,
                'fileTypeDesc': '图片文件',
                'fileTypeExts': '*.gif; *.jpg; *.png;*.*',
                'removeCompleted': false,
                //'queueSizeLimit'：3,//设置上传队列中同时允许的上传文件数量，默认为999。

                //文件上传完成时触发事件。
                'onUploadComplete': function (file) {
                    //alert('The file ' + file.name + ' finished processing.');
                },
                //队列中全部文件上传完成时触发事件。
                'onQueueComplete': function (queueData) {
                    //alert(queueData.uploadsSuccessful + ' files were successfully uploaded.');
                },
                'onUploadError': function (file, errorCode, errorMsg, errorString) {
                    alert('The file ' + file.name + ' could not be uploaded: ' + errorString);
                }
            });
        });
    </script>

</head>
<body>
    <form>
        <div id="fileQueue">files </div>
        <input type="file" name="uploadify" id="uploadify" />
        <p>

            <a href="javascript:$('#uploadify').uploadify('upload');">上传第一个</a>
            <a href="javascript:$('#uploadify').uploadify('upload','*');">上传队列</a>
            <a href="javascript:$('#uploadify').uploadify('cancel');">取消第一个</a>
            <a href="javascript:$('#uploadify').uploadify('cancel', '*');">取消队列</a>
        </p>
    </form>
</body>
</html>
